package com.scoy.honeymei.activity.mall;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager.widget.ViewPager;

import com.google.android.material.tabs.TabLayout;
import com.google.gson.Gson;
import com.lzy.okgo.model.HttpParams;
import com.scoy.honeymei.R;
import com.scoy.honeymei.adapter.BookListAdapter;
import com.scoy.honeymei.adapter.tabadapter.TabFragmentIntAdapter;
import com.scoy.honeymei.base.BaseActivity;
import com.scoy.honeymei.bean.CateBean;
import com.scoy.honeymei.bean.FilmOrderBean;
import com.scoy.honeymei.fragment.DypFragment;
import com.scoy.honeymei.fragment.me.IncomeFragment;
import com.scoy.honeymei.fragment.me.WithdrawFragment;
import com.scoy.honeymei.http.HpCallback;
import com.scoy.honeymei.http.HpGo;
import com.scoy.honeymei.url.ApiCallBack;
import com.scoy.honeymei.url.MeConstant;
import com.scoy.honeymei.url.MyUrl;
import com.scoy.honeymei.utils.MyUtil;
import com.scoy.honeymei.utils.SPHelper;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.scwang.smartrefresh.layout.api.RefreshLayout;
import com.scwang.smartrefresh.layout.listener.OnLoadMoreListener;
import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
import com.umeng.commonsdk.debug.I;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * @ClassName: CouponActivity$
 * @Description: 订票界面
 * @Author: GaoZhan
 * @CreateDate: 2019/9/2/0002$ 下午 14:26$
 * @UpdateUser: 更新者
 * @UpdateDate: 2019/9/2/0002$ 下午 14:26$
 * @UpdateRemark: 更新内容
 */
public class BookActivity extends BaseActivity {


    @BindView(R.id.back_iv)
    ImageView backIv;
    @BindView(R.id.title_tv)
    TextView titleTv;
    @BindView(R.id.sign_tv)
    TextView signTv;
    @BindView(R.id.title_llt)
    LinearLayout titleLlt;

    @BindView(R.id.mct_tab)
    TabLayout mctTab;
    @BindView(R.id.mct_vp)
    ViewPager mctVp;
    private BookActivity mContext;


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.custom_activity_list);
        ButterKnife.bind(this);
        mContext = BookActivity.this;

        initNormal();
        initTab();
    }

    private void initTab() {
        int[] mTitles = new int[]{R.string.dyp_dsy, R.string.dyp_ysy, R.string.dyp_ytp};
        ArrayList<Fragment> fragments = new ArrayList<>();
        fragments.add(DypFragment.newInstance(0));
        fragments.add(DypFragment.newInstance(1));
        fragments.add(DypFragment.newInstance(-2));

        TabFragmentIntAdapter tabFragmentAdapter = new TabFragmentIntAdapter(mContext, getSupportFragmentManager(), fragments, mTitles);
        mctTab.setupWithViewPager(mctVp, false);
        mctVp.setAdapter(tabFragmentAdapter);
        mctVp.setCurrentItem(0);
    }

    @Override
    public void initNormal() {
        titleTv.setText(R.string.book2);
        MyUtil.setStatusBar(mContext, getWindow(), true, R.color.colorWhite);
        titleLlt.setPadding(0, MyUtil.getStatusBarHeight(mContext), 0, 0);
    }


    @OnClick({R.id.back_iv, R.id.title_tv})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.back_iv:
                finish();
                break;
            case R.id.title_tv:
                break;
        }
    }
}
